package com.et.util

import android.util.Log
import com.et.logger.TAGS
import org.junit.Test
import java.io.File

class HttpUtilKtTest {

    @Test
    fun download() {
        val file = File("/sdcard/${System.currentTimeMillis()}.download")
        val url =
            "http://testsource.easytouch-manager.com/PIC/%E6%B5%8B%E8%AF%95%E5%85%AC%E5%8F%B8/0BKh95sKSnjwo5DPNMD7YEw7jNr3WtlQ.png"
        file.download(url) {
            if (it < 0) {
                Log.d(TAGS.vending, "vending:callback download failed")
            } else if (it == 1f) {
                Log.d(TAGS.vending, "vending:callback download finish")
            }
        }
    }
}